﻿
@{
    ViewBag.Title = "EmployeePageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css{
    <link rel="stylesheet" href="~/assets/portal/assets/css/common.css" />
    <link rel="stylesheet" href="~/bussiness/js/base/reset.css" />
    <link rel="stylesheet" href="~/bussiness/js/pg/Performance/edit.css" />
    <style>

        #editor—wrapper {
            /*max-width: 90%;*/
            width: 1200px !important;
            border: 1px solid #ccc;
            z-index: 100; /*  按需定义 */
        }

        .title {
            font-weight: bolder;
        }

        #toolbar-container {
            border-bottom: 1px solid #ccc;
        }

        #editor-container {
            min-height: 310px;
            margin-bottom: 200px;
        }

            #editor-container .title::before {
                content: ""
            }

        .ant-select-arrow, .ant-select-clear {
            position: absolute;
            right: 10px;
        }

        .stitle {
            font-size: 16px;
            font-weight: 600;
            color: #424758;
            display: flex;
            align-items: center;
        }

            .stitle::before {
                content: "";
                margin-right: 10px;
                display: inline-block;
                width: 4px;
                height: 18px;
                background: #0064E5;
            }

        .stable {
            border-collapse: collapse; /* 折叠边框，使之变为单一线划分 */
            border: 1px solid #e1e5ea; /* 设置表格、表头、单元格边框 */
            width: 100%;
            max-height: 800px;
            overflow-y: scroll;
        }

            .stable th {
                background: #f2f6f9;
                font-size: 14px;
                font-weight: 600;
            }

            .stable th, .stable td {
                border: 1px solid #e1e5ea; /* 设置表格、表头、单元格边框 */
                text-align: center;
                height: 48px;
            }
    </style>
}
<div id="EmergencyManagementEMADD" class="font-['SourceHanSansSC']">
    <a-style-provider hash-priority="high">
        <a-config-provider :locale="vlocale">
            <a-image :width="200"
                     :style="{ display: 'none',zIndex:100 }"
                     :preview="{visible:EmergencyManagementEMADDParams.previewShow.value,onVisibleChange:EmergencyManagementEMADDParams.setVisible}" :src="EmergencyManagementEMADDParams.imgUrl.value"></a-image>
            <m-pdf-pop-model></m-pdf-pop-model>
            <header class="px-5 box-border">
                <div class="flex items-center">
                    <div class="w-full h-[48px] text-[13px]  rounded-lg mx-auto my-[10px]  bg-white  text-[#888888] text-3xl flex items-center px-10">   <div class="w-22 h-22 bg-blue-200 mr-5"> <img class="w-full h-full cursor-pointer" v-on:click="EmergencyManagementEMADDParams.vvback()" src="~/Assets/nimgs/exit.png" alt="返回" /></div> <span class="text-[]">应急管理<span class="mx-2">/</span><span class="text-[#424758] text-[15px]">{{EmergencyManagementEMADDParams.urlinfo.value.type?{1:'应急物资编辑',9:'应急物资详情'}[EmergencyManagementEMADDParams.urlinfo.value.type]:'新增应急物资'}}  </span> </span>  </div>
                </div>
                <a-card :bordered="true" class="w-full  mt-12">
                    <template #title>
                        <div class="w-full flex justify-between items-center;">
                            <div class="flex items-center"> <div>应急物资({{EmergencyManagementEMADDParams.urlinfo.value.l==2?'部门级':'公司级'}})</div> <div class="ml-7"></div></div>
                        </div>
                    </template>
                    <a-spin :spinning="EmergencyManagementEMADDParams.uploadLock.value" tip="加载中，请耐心等待..." />
                    <div class="stitle" style="margin:20px 0">基本信息</div>
                    <a-form style="margin-top:10px"
                            ref="FormRule"
                            layout="inline"
                            :rules="EmergencyManagementEMADDParams.rules.value"
                            :model="EmergencyManagementEMADDParams.formData.value">
                        @*<a-form-item label="物资内容：" name="SupplyName">
                            <a-input allow-clear placeholder="请输入物资内容" :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9" v-model:value="EmergencyManagementEMADDParams.formData.value.SupplyName" style="width: 200px" />
                        </a-form-item>*@
                        <a-form-item label="提交人：">
                            <a-input disabled v-model:value="EmergencyManagementEMADDParams.formData.value.user" style="width:200px" />
                        </a-form-item>
                        <a-form-item label="提交日期：">
                            <a-input disabled v-model:value="EmergencyManagementEMADDParams.formData.value.time" style="width: 200px" />
                        </a-form-item>
                        <a-form-item  label="提交部门：">
                            <a-select 
                                      show-search
                                      style="width:200px"
                                      :filter-option="EmergencyManagementEMADDParams.filterOption"
                                      placeholder="请选择部门"
                                      :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9||EmergencyManagementEMADDParams.urlinfo.value.l==1"
                                      v-model:value="EmergencyManagementEMADDParams.formData.value.DepartmentId"
                                      :options="EmergencyManagementEMADDParams.deptList.value">

                            </a-select>
                        </a-form-item>

                    </a-form>
                    <div class="stitle" style="margin:20px 0">物资信息</div>
                    <a-card :bordered="true" class="w-full  mt-12">
                        <template #title>
                            <div class="w-full flex justify-between items-center;">
                                <div class="flex items-center"> <div>物资信息列表</div> <div class="ml-7"></div></div>
                                <div v-if="EmergencyManagementEMADDParams.urlinfo.value.type!=9">
                                    <a-space>
                                        <a-button v-on:click="EmergencyManagementEMADDParams.handleDownloadTemplate" style="background: #17d46b;color:white">下载模版</a-button>
                                        <a-upload v-model:file-list="EmergencyManagementEMADDParams.uploadImg.value.fileList"
                                                  action="#"
                                                  :show-upload-list="false"
                                                  v-on:change="EmergencyManagementEMADDParams.handleChange">
                                            <a-button v-if="EmergencyManagementEMADDParams.uploadImg.value.fileList.length < 8 && EmergencyManagementEMADDParams.urlinfo.value.type!=9" type="primary">导入模版</a-button>
                                        </a-upload>
                                    </a-space>
                                </div>
                            </div>
                        </template>
                        <table class="stable">
                            <tr>
                                <th>序号</th>
                                <th>厂区</th>
                                <th>物资名称</th>
                                <th>数量</th>
                                <th>单位</th>
                                <th>责任人</th>
                                <th>联系方式</th>
                                <th>保管位置</th>
                                <th>有效期</th>
                                <th v-if="EmergencyManagementEMADDParams.urlinfo.value.type!=9"><a-button v-on:click="EmergencyManagementEMADDParams.addConfig" type="primary">新增</a-button></th>
                            </tr>
                            <tr v-for="(e,i) in EmergencyManagementEMADDParams.settingList.value" :key="i">
                                <td>
                                    {{i+1}}
                                </td>
                                <td>


                                    <a-select show-search
                                              style="width:200px"
                                              :filter-option="EmergencyManagementEMADDParams.filterOption"
                                              placeholder="请选择部门"
                                              :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9"
                                              v-model:value="e.FactoryAreaId"
                                              :options="EmergencyManagementEMADDParams.FactoryAreaList.value">

                                    </a-select>

                                </td>
                                <td>
                                    <a-input style="width: 100px" :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9" v-model:value="e.Name">
                                    </a-input>
                                </td>
                                <td>
                                    <a-input-number v-model:value="e.Quantity" :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9" :min="0" />
                                </td>
                                <td>
                                    <a-input style="width: 100px" :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9" v-model:value="e.Unit">
                                    </a-input>
                                </td>
                                <td>
                                    <a-input style="width:100px" :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9" v-model:value="e.Responsible">
                                    </a-input>
                                </td>
                                <td>
                                    <a-input style="width: 100px" :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9" v-model:value="e.Contact">
                                    </a-input>
                                </td>
                                <td>
                                    <a-input style="width: 100px" :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9" v-model:value="e.Place">
                                    </a-input>
                                </td>
                                <td>
                       
                                    <a-date-picker :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9"  v-model:value="e.ValidDate" />
                         
                                    @*<a-input style="width: 100px" v-model:value="e.ValidDate">
        </a-input>*@
                                </td>
                                <td v-if="EmergencyManagementEMADDParams.urlinfo.value.type!=9">

                                    <a-button v-on:click="EmergencyManagementEMADDParams.delConfig(i)" type="primary" danger>删除</a-button>
                                </td>
                            </tr>
                        </table>

                    </a-card>
                    @*<a-form-item label="附件：">
            <a-upload v-model:file-list="EmergencyManagementEMADDParams.uploadImg.value.fileList"
                      action="#"
                      :item-render="EmergencyManagementEMADDParams.itemRender.value"
                      v-on:change="EmergencyManagementEMADDParams.handleChange">
                <a-button v-if="EmergencyManagementEMADDParams.uploadImg.value.fileList.length < 8 && EmergencyManagementEMADDParams.urlinfo.value.type!=9" type="primary">+ 上传附件</a-button>

            </a-upload>
        </a-form-item>*@
                    <a-form-item label-align="right" style="margin-top:20px" label="备注：">
                        <a-textarea style="width:600px" :disabled="EmergencyManagementEMADDParams.urlinfo.value.type==9" v-model:value="EmergencyManagementEMADDParams.formData.value.Remark">
                        </a-textarea>
                    </a-form-item>
                </a-card>

</header>
            <m-bottom-btns></m-bottom-btns>
        </a-config-provider>
    </a-style-provider>
</div>
@section Js{
    <script src="~/bussiness/js/base/tailwind.js"></script>
    <script>
    </script>
    <script type="module">
        import Composition from '../../bussiness/js/pg/EmergencyManagement/EMAdd.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")'
        import localeValues from '../../Bussiness/js/base/es/locale/zh_CN.js'
        singalApp('EmergencyManagementEMADD', Composition, localeValues)
    </script>
}
